﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BartonExtension;

namespace WSServer
{
    public static class WSTokenManager
    {

        const int DEFAULT_EXPIRED_IN_INTERVAL = 7200;
        public static void AssignAccessCodeToSocket(this WSSocket socket)
        {
            WSAccessToken acs_token = new WSAccessToken()
            {
                access_token = IDGenerator.GenerateID().ToString(),
                createTime = DateTime.Now,
                expired_in = DEFAULT_EXPIRED_IN_INTERVAL
            };
            socket.token = acs_token;
        }
    }
}
